array to string separated by comma php

121

array to string separated by comma php -

$arr = array ( 0 => "lorem", 1 => "ipsum", 2 => "dolor");

$str = implode (", ", $arr);

php change array into comma delimited string -

 $tags = implode(', ', array('tag1','tag2','tag3','tag4'));

how to convert array to string with commas in php -

$string = implode(', ', $tags);

Comments

Submit
0 Comments